//@author A0087294-unused
//because I coded GUI I have no files to show unit testing
//thus, I coded a mini project that mirrors the original project 
//with some user commands. This mini project has unit testing
//in it for grading purposes.

#include "stdafx.h"
#include "CppUnitTest.h"
#include "testUnitTest.h"

#include <string>;

using namespace Microsoft::VisualStudio::CppUnitTestFramework;

namespace UnitTest1
{		
	TEST_CLASS(UnitTest1)
	{
	public:
		
		TEST_METHOD(TestMethod1)
		{
			testUnitTest* testunitTest = new testUnitTest;

			string MESSAGE_1 = "doing something now";
			string MESSAGE_2 = "watching Walking Dead with friend";
			string MESSAGE_3 = "going out later to Cineleisure";

			string MESSAGE_4 = "watching X-Men Days of Future Past with friend";
			string MESSAGE_5 = "staying at home. Boring life!";


			//add
			Assert::AreEqual(testunitTest->addToVector(MESSAGE_1), true);
			Assert::AreEqual(testunitTest->addToVector(MESSAGE_2), true);
			Assert::AreEqual(testunitTest->addToVector(MESSAGE_3), true);
			
			//edit
			Assert::AreEqual(testunitTest->editStringInVector(MESSAGE_4, 2), true); // within boundary
			Assert::AreEqual(testunitTest->editStringInVector(MESSAGE_4, 4), false); // +1 outside boundary
			Assert::AreEqual(testunitTest->editStringInVector(MESSAGE_4, -1), false); // negative value
			Assert::AreEqual(testunitTest->editStringInVector(MESSAGE_4, 100), false); // far off from boundary 
			Assert::AreEqual(testunitTest->editStringInVector(MESSAGE_5, 3), true); // at positive edge of boundary

			//delete
			Assert::AreEqual(testunitTest->deleteFromVector(1), true); // at negative edge of boundary
			Assert::AreEqual(testunitTest->deleteFromVector(-5),false); // negative value
			Assert::AreEqual(testunitTest->deleteFromVector(4), false); // +1 outside of boundary
			Assert::AreEqual(testunitTest->deleteFromVector(10), false); // far off from boundary

		}

	};
}